import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/emergency/emergency_res_team_detail_entity.dart';

EmergencyResTeamDetailEntity $EmergencyResTeamDetailEntityFromJson(Map<String, dynamic> json) {
  final EmergencyResTeamDetailEntity emergencyResTeamDetailEntity = EmergencyResTeamDetailEntity();
  final String? address = jsonConvert.convert<String>(json['address']);
  if (address != null) {
    emergencyResTeamDetailEntity.address = address;
  }
  final String? affiliatedUnit = jsonConvert.convert<String>(json['affiliatedUnit']);
  if (affiliatedUnit != null) {
    emergencyResTeamDetailEntity.affiliatedUnit = affiliatedUnit;
  }
  final String? annexToTheAgreement = jsonConvert.convert<String>(json['annexToTheAgreement']);
  if (annexToTheAgreement != null) {
    emergencyResTeamDetailEntity.annexToTheAgreement = annexToTheAgreement;
  }
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    emergencyResTeamDetailEntity.companyCode = companyCode;
  }
  final String? contactInformation = jsonConvert.convert<String>(json['contactInformation']);
  if (contactInformation != null) {
    emergencyResTeamDetailEntity.contactInformation = contactInformation;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    emergencyResTeamDetailEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    emergencyResTeamDetailEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    emergencyResTeamDetailEntity.createDate = createDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    emergencyResTeamDetailEntity.deleted = deleted;
  }
  final String? emergencyPointIds = jsonConvert.convert<String>(json['emergencyPointIds']);
  if (emergencyPointIds != null) {
    emergencyResTeamDetailEntity.emergencyPointIds = emergencyPointIds;
  }
  final String? establishmentTime = jsonConvert.convert<String>(json['establishmentTime']);
  if (establishmentTime != null) {
    emergencyResTeamDetailEntity.establishmentTime = establishmentTime;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    emergencyResTeamDetailEntity.id = id;
  }
  final String? materialAttachments = jsonConvert.convert<String>(json['materialAttachments']);
  if (materialAttachments != null) {
    emergencyResTeamDetailEntity.materialAttachments = materialAttachments;
  }
  final List<dynamic>? materialPointIdList = (json['materialPointIdList'] as List<dynamic>?)?.map(
          (e) => e).toList();
  if (materialPointIdList != null) {
    emergencyResTeamDetailEntity.materialPointIdList = materialPointIdList;
  }
  final String? periodOfCooperation = jsonConvert.convert<String>(json['periodOfCooperation']);
  if (periodOfCooperation != null) {
    emergencyResTeamDetailEntity.periodOfCooperation = periodOfCooperation;
  }
  final String? responsiblePerson = jsonConvert.convert<String>(json['responsiblePerson']);
  if (responsiblePerson != null) {
    emergencyResTeamDetailEntity.responsiblePerson = responsiblePerson;
  }
  final String? teamClassification = jsonConvert.convert<String>(json['teamClassification']);
  if (teamClassification != null) {
    emergencyResTeamDetailEntity.teamClassification = teamClassification;
  }
  final String? teamName = jsonConvert.convert<String>(json['teamName']);
  if (teamName != null) {
    emergencyResTeamDetailEntity.teamName = teamName;
  }
  final int? totalNumberOfPeople = jsonConvert.convert<int>(json['totalNumberOfPeople']);
  if (totalNumberOfPeople != null) {
    emergencyResTeamDetailEntity.totalNumberOfPeople = totalNumberOfPeople;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    emergencyResTeamDetailEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    emergencyResTeamDetailEntity.updateById = updateById;
  }
  final String? estimateName = jsonConvert.convert<String>(json['estimateName']);
  if (estimateName != null) {
    emergencyResTeamDetailEntity.estimateName = estimateName;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    emergencyResTeamDetailEntity.updateDate = updateDate;
  }
  return emergencyResTeamDetailEntity;
}

Map<String, dynamic> $EmergencyResTeamDetailEntityToJson(EmergencyResTeamDetailEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['address'] = entity.address;
  data['affiliatedUnit'] = entity.affiliatedUnit;
  data['annexToTheAgreement'] = entity.annexToTheAgreement;
  data['companyCode'] = entity.companyCode;
  data['contactInformation'] = entity.contactInformation;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deleted'] = entity.deleted;
  data['emergencyPointIds'] = entity.emergencyPointIds;
  data['establishmentTime'] = entity.establishmentTime;
  data['id'] = entity.id;
  data['materialAttachments'] = entity.materialAttachments;
  data['materialPointIdList'] = entity.materialPointIdList;
  data['periodOfCooperation'] = entity.periodOfCooperation;
  data['responsiblePerson'] = entity.responsiblePerson;
  data['teamClassification'] = entity.teamClassification;
  data['teamName'] = entity.teamName;
  data['totalNumberOfPeople'] = entity.totalNumberOfPeople;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['estimateName'] = entity.estimateName;
  data['updateDate'] = entity.updateDate;
  return data;
}

extension EmergencyResTeamDetailEntityExtension on EmergencyResTeamDetailEntity {
  EmergencyResTeamDetailEntity copyWith({
    String? address,
    String? affiliatedUnit,
    String? annexToTheAgreement,
    String? companyCode,
    String? contactInformation,
    String? createBy,
    String? createById,
    String? createDate,
    String? deleted,
    String? emergencyPointIds,
    String? establishmentTime,
    String? id,
    String? materialAttachments,
    List<dynamic>? materialPointIdList,
    String? periodOfCooperation,
    String? responsiblePerson,
    String? teamClassification,
    String? teamName,
    int? totalNumberOfPeople,
    String? updateBy,
    String? updateById,
    String? estimateName,
    String? updateDate,
  }) {
    return EmergencyResTeamDetailEntity()
      ..address = address ?? this.address
      ..affiliatedUnit = affiliatedUnit ?? this.affiliatedUnit
      ..annexToTheAgreement = annexToTheAgreement ?? this.annexToTheAgreement
      ..companyCode = companyCode ?? this.companyCode
      ..contactInformation = contactInformation ?? this.contactInformation
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deleted = deleted ?? this.deleted
      ..emergencyPointIds = emergencyPointIds ?? this.emergencyPointIds
      ..establishmentTime = establishmentTime ?? this.establishmentTime
      ..id = id ?? this.id
      ..materialAttachments = materialAttachments ?? this.materialAttachments
      ..materialPointIdList = materialPointIdList ?? this.materialPointIdList
      ..periodOfCooperation = periodOfCooperation ?? this.periodOfCooperation
      ..responsiblePerson = responsiblePerson ?? this.responsiblePerson
      ..teamClassification = teamClassification ?? this.teamClassification
      ..teamName = teamName ?? this.teamName
      ..totalNumberOfPeople = totalNumberOfPeople ?? this.totalNumberOfPeople
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..estimateName = estimateName ?? this.estimateName
      ..updateDate = updateDate ?? this.updateDate;
  }
}
